#include <iostream>


/**
 * 
 * 计算各位和
 * 
 */
int main() {

    int n;
    std::cin >> n;

    int sum = 0;

    int gewei = n % 10;
    sum = sum + gewei;


    n = n / 10;
    int shiwei = n % 10;
    sum = sum + shiwei;

    n = n / 10;
    int baiwei = n % 10;
    sum = sum + baiwei;

    n = n / 10;
    int qianwei = n % 10;
    sum = sum + qianwei;

    n = n / 10;
    int wanwei = n % 10;
    sum = sum + wanwei;

    std::cout << sum << std::endl;

    return 0;
}